<?php
/**
 * 门店管理
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019-04-08
 * Time: 下午 3:05
 */

use Model\SettingMod;

defined('IN_IA') or exit('Access Denied');
global $_GPC,$_W;
require MODULE_ROOT.'/vendor/autoload.php';

if($_W['container'] != 'wechat' || $_W['os'] != 'mobile'){
	message('本系统仅支持在手机端微信打开','','info');
	exit;
}
checkauth();

$Setting = new SettingMod();
$_setting = $Setting->findOne(array('uniacid'=>$_W['account']['uniacid']),array('map_key'));
$_script = "
    <script>
       window.sysinfo = {
           url:'".$this->createMobileUrl('api')."',
           uid:'".$_W['member']['uid']."',
           uniacid:'".$_W['account']['uniacid']."',
           header:'".$_W['fans']['tag']['headimgurl']."',
           nickname:'".$_W['fans']['nickname']."',
           openid:'".$_W['openid']."',
           webname:'门店管理',
           attachurl_local:'".$_W['attachurl_local']."',
           develop:false
       }
    </script>
    <script src='".$_W['sitescheme']."webapi.amap.com/maps?v=1.4.15&key=".$_setting['map_key']."&plugin=AMap.Geolocation'></script>
    <script src='".$_W['sitescheme']."res.wx.qq.com/open/js/jweixin-1.4.0.js'></script>
    <script> 
        wx.config({
                   debug:false,
                   appId:'".$_W['account']['jssdkconfig']['appId']."',
                   timestamp:'".$_W['account']['jssdkconfig']['timestamp']."',
                   nonceStr:'".$_W['account']['jssdkconfig']['nonceStr']."',
                   signature:'".$_W['account']['jssdkconfig']['signature']."',
                   jsApiList: ['scanQRCode']
                });
    </script>
";


include $this->template('store');